list01=["the","of","a","you"]

def getText():
    text=open("hamlet.txt","r").read()
    text=text.lower()
    s='!#$%&()*+,-./:;<=>?@[\\]^_‘{|}~'
    for i in s:
        text=text.replace(i," ")
    return text

# split是作用在字符串上
text=getText()
list02=text.split()
zi={}
for i in list02:
    zi[i]=zi.get(i,0)+1
for j in list01:
    del(zi[j])
shuzu=list(zi.items())
shuzu.sort(key=lambda x:x[1],reverse=True)
for i in range(10):
    k=shuzu[i][0]
    v=shuzu[i][1]
    print("{0:<10}{1:>5}".format(k,v))



